

const { ccclass, property } = cc._decorator;

@ccclass
export default class Tween_move extends cc.Component {
    @property(cc.Vec2)
    v2: cc.Vec2 = null;
    @property()
    time: number = 1;
    start() {
        cc.tween(this.node)
            .by(this.time, { position: cc.v3(this.v2.x, this.v2.y) })
            .by(0, { position: cc.v3(-this.v2.x, -this.v2.y) })
            .union()
            .repeatForever()
            .start();
    }
}
